import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';

/**
 * Generated class for the AllclassroomPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-allclassroom',
  templateUrl: 'allclassroom.html',
})
export class AllclassroomPage {
  clssroomList = [];
  objectKeys = Object.keys;
  constructor(public navCtrl: NavController, public navParams: NavParams, private busi:BusiProvider) {

  }

  ionViewDidEnter(){
    this.getAllClassRoom();
  }
  ionViewDidLoad() {
    console.log('ionViewDidLoad AllclassroomPage');
  }

  getAllClassRoom(){
    this.busi.getAllClassRoom().subscribe(
      data=>{
        this.clssroomList = data.classroominfo;
      }
    );
  }

  showClassRoomDetail(key,detail){
    this.navCtrl.push("ClassroomdetailPage",{classroom:key,detail:detail})
  }

}
